/*
 * Canvas Game Library
 * Module: Entity
 * 
 * Copyright Chainsawrus Wreaks 2011
 * All rights reserved.
 */

/**
 * @fileOverview A module that gives CGL a entity based engine, these little buggers will be able to chew all
 * the methods you throw at them! Do you want them to contain and render images? Work with the collision 
 * engine? Or have event input behavior? This little star will do it all for you!
 */

/**
 * Tile module namespace
 * @namespace CGL.entity
 */

CGL.entity = {
		
	UNIQUE_ID : 0,
		
	Entity : function() {
		var entity = {
			modules : new Array(32),
			
			init : function() {
				var uid = CGL.entity.UNIQUE_ID;
				entity.modules[0] = uid;
				CGL.entity.UNIQUE_ID++;
			},
			
			addModule : function(type, module) {
				entity.modules[type] = module;
			},
			
			deleteModule : function(type) {
				entity.modules[type] = undefined;
			},
				
			haveModule : function(module) {
				return (entity.modules[module] != undefined);
			}
		};
		return entity;
	}	
};

CGL.entity.modules = {
		
};